<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 员工管理控制器
 */
class Employ extends AdminBase
{
    
    /**
     * 员工列表
     */
    public function employList()
    {
        
        $this->assign('list', $this->logicEmploy->getEmployList());
        
        return $this->fetch('employ_list');
    }
    
    /**
     * 员工添加
     */
    public function employAdd()
    {
        
        IS_POST && $this->jump($this->logicEmploy->employEdit($this->param));
        
        return $this->fetch('employ_edit');
    }
    
    /**
     * 员工编辑
     */
    public function employEdit()
    {
        
        IS_POST && $this->jump($this->logicEmploy->employEdit($this->param));
        
        $info = $this->logicEmploy->getEmployInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('employ_edit');
    }
    
    /**
     * 员工删除
     */
    public function employDel($id = 0)
    {
        
        $this->jump($this->logicEmploy->employDel(['id' => $id]));
    }
      /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('Employ', $this->param));
    }
    
}
